import { createApp } from 'vue'
import './index.css'
import ElementPlus from 'element-plus'
import router from './router'
import '@/styles/reset.scss'
import 'element-plus/dist/index.css'
import { setupStore } from '@/stores'
import App from './App.vue'
// 本地SVG图标
import 'virtual:svg-icons-register'

// 引入echarts
import echarts from './utils/echarts'

import SvgIcon from '@/components/SvgIcon/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

app.provide('$echarts', echarts) // vue3采用provide, inject方式使用
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 全局注册 状态管理(store)
setupStore(app)
app.component('SvgIcon', SvgIcon)
app.use(router)
app.use(ElementPlus).mount('#app')
